package com.bw.shop_2302.user

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.bw.base.entity.Res
import com.bw.base.entity.UserEntity
import com.bw.base.mvvm.BaseViewModel
import kotlinx.coroutines.launch

class UserViewModel:BaseViewModel() {

    var usersuccess=MutableLiveData<Res<UserEntity>>()
    var userfail=MutableLiveData<String>()

    fun user(){

        viewModelScope.launch {
            try {

                usersuccess.value=apiServer.User()
            }catch (e:Exception){
                userfail.value=e.message
            }
        }

    }
}